package com.leo;

import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;

/**
 * @ClassName LineDemo
 * @Description
 * @Author wangss
 * @date 2020.07.01 22:41
 * @Version 1.0
 */
public class CircleDemo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        AnchorPane an = new AnchorPane();

        HBox hBox = new HBox(200);
        hBox.setAlignment(Pos.CENTER);

        Circle circle = new Circle(100);
        circle.setFill(Color.GREEN);
        circle.setStroke(Color.RED);
        circle.setStrokeWidth(4);
        circle.getStrokeDashArray().addAll(10d, 20d);

        hBox.getChildren().addAll(circle);

        an.getChildren().add(hBox);
        AnchorPane.setTopAnchor(hBox, 50d);
        AnchorPane.setLeftAnchor(hBox, 50d);

        Scene scene = new Scene(an);
        primaryStage.setScene(scene);
        primaryStage.setHeight(1000d);
        primaryStage.setWidth(1500d);
        primaryStage.setAlwaysOnTop(true);
        primaryStage.show();
    }
}
